<template>
  <cube-rate v-model="value" @input="input" v-if="!disabled"></cube-rate>
  <cube-rate v-model="number" @input="input" v-else :disabled="disabled"></cube-rate>
   
</template>

<script>
export default {
  name: 'Star',
  props: {
    number: {
      required: false,
      default: 1
    },
    disabled: {
      required: false,
      default: false
    }
  },
  data () {
    return {
      value: Math.floor(this.number)
    }
  },
  methods: {
    input (value) {
      this.$emit('starInput', value);
    }
  }
}
</script>

<style lang="stylus" scoped>

</style>
